from SconsUtils import cunit
from SconsUtils import utils

Import("env")

if utils.HEADERS.get("HAVE_CUNIT"):
    programs = Split("""
    resolver.c zip.c
    rdfvalues.c image.c
    aff4_objects.c utils.c
    """)

    nenv = env.Clone()
    nenv.Append(CFLAGS="-Ilibreplace -Ilib -g -O0 ")

    cunit.buildCUnitTestFromFiles(nenv, programs,
                                  extraObjects = Split(env.libaff4_static_lib),
                                  CFLAGS=" -lxml -g -O0 ", LIBPATH="#lib/")
else:
    utils.warn("CUnit not found. Skipping unit tests.")
